subroutine EVret(n,riskret,sav,gcash,V,secd,ncash,weig,survprob,rho,auxVV)
INTEGER, INTENT(IN) :: ncash, n
REAL, INTENT(IN) :: sav, survprob, rho
REAL, INTENT(IN) :: riskret(n,1), V(ncash,1), secd(ncash,1), weig(n,1), gcash(ncash,1)
double precision, INTENT(OUT) :: auxVV
double precision :: int_V
INTEGER :: i8
  
auxVV=0.0
do i8=1,n
   cash_1= riskret(i8,1)*sav  
   cash_1 = max(min(cash_1,gcash(ncash,1)),gcash(1,1))
   call sc_splint(gcash(:,1),V(:,1),secd(:,1),ncash,cash_1,int_V)
   auxVV=auxVV+weig(i8,1)*survprob*(int_V**(1.0-rho))
end do   !i8

end subroutine
